import axios from 'axios'
import {
    apiVersion
} from '../config'

const removeEmpty = true
export default {
    /**
     * 列表
     * @param {*} params
     */
    list(params) {
        return axios({
            url: `/demo`,
            method: 'GET',
            params,
            removeEmpty,
            responseType: 'json'
        })
    },
    /**
     * 详情
     * @param {*} id
     */
    get(id) {
        return axios({
            url: `/demo/${id}`,
            method: 'GET',
            responseType: 'json'
        })
    },
    /**
     * 新增
     * @param {*} data
     */
    save(data) {
        return axios({
            url: `/demo`,
            method: 'POST',
            data
        })
    },
    /**
     * 更新
     * @param {*} data
     */
    update(data) {
        return axios({
            url: `/demo`,
            method: 'PUT',
            data
        })
    },
    /**
     * 删除
     * @param {*} ids
     */
    del(ids) {
        return axios({
            url: `/demo/${ids}`,
            method: 'DELETE'
        })
    }
}